<script>
  /* function Person(name, age) {
    this.name = name;
    this.age = age
  }
  Person.prototype.say = function () {
    console.log('Hello World')
  } */

  class Person {
    // 只要 new Person('ifer', 18) 会自动执行 constructor 这个函数
    constructor(name, age) {
      // this => 实例
      // 实例属性
      this.name = name;
      this.age = age
      this.show = function() {}
    }
    // 原型方法
    say() {
      console.log('Hello World')
    }
    show() {}
    // 静态方法
    static abc = 'def'
    static show = () => {
      console.log('666')
    }
  }
  // Person.show = function() {}
  /* const p1 = new Person('ifer', 18)
  const p2 = new Person('elser', 19)
  console.log(p1.say === p2.say) */

  class Star extends Person {}

  const wsc = new Star('wsc', 30);
  // console.log(wsc)
  // wsc.say()
  Person.show()
</script>